package com.imc.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ImcDeptPurivewId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class ImcDeptPurivewId implements java.io.Serializable {

	// Fields

	private Integer roleId;
	private Integer organId;
	private Integer corpId;
	private Integer purivewType;

	// Constructors

	/** default constructor */
	public ImcDeptPurivewId() {
	}

	/** full constructor */
	public ImcDeptPurivewId(Integer roleId, Integer organId, Integer corpId,
			Integer purivewType) {
		this.roleId = roleId;
		this.organId = organId;
		this.corpId = corpId;
		this.purivewType = purivewType;
	}

	// Property accessors

	@Column(name = "ROLE_ID")
	public Integer getRoleId() {
		return this.roleId;
	}

	public void setRoleId(Integer roleId) {
		this.roleId = roleId;
	}

	@Column(name = "ORGAN_ID")
	public Integer getOrganId() {
		return this.organId;
	}

	public void setOrganId(Integer organId) {
		this.organId = organId;
	}

	@Column(name = "CORP_ID")
	public Integer getCorpId() {
		return this.corpId;
	}

	public void setCorpId(Integer corpId) {
		this.corpId = corpId;
	}

	@Column(name = "purivew_type")
	public Integer getPurivewType() {
		return this.purivewType;
	}

	public void setPurivewType(Integer purivewType) {
		this.purivewType = purivewType;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ImcDeptPurivewId))
			return false;
		ImcDeptPurivewId castOther = (ImcDeptPurivewId) other;

		return ((this.getRoleId() == castOther.getRoleId()) || (this
				.getRoleId() != null && castOther.getRoleId() != null && this
				.getRoleId().equals(castOther.getRoleId())))
				&& ((this.getOrganId() == castOther.getOrganId()) || (this
						.getOrganId() != null && castOther.getOrganId() != null && this
						.getOrganId().equals(castOther.getOrganId())))
				&& ((this.getCorpId() == castOther.getCorpId()) || (this
						.getCorpId() != null && castOther.getCorpId() != null && this
						.getCorpId().equals(castOther.getCorpId())))
				&& ((this.getPurivewType() == castOther.getPurivewType()) || (this
						.getPurivewType() != null
						&& castOther.getPurivewType() != null && this
						.getPurivewType().equals(castOther.getPurivewType())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getRoleId() == null ? 0 : this.getRoleId().hashCode());
		result = 37 * result
				+ (getOrganId() == null ? 0 : this.getOrganId().hashCode());
		result = 37 * result
				+ (getCorpId() == null ? 0 : this.getCorpId().hashCode());
		result = 37
				* result
				+ (getPurivewType() == null ? 0 : this.getPurivewType()
						.hashCode());
		return result;
	}

}